<?php PageUtil::addVar("stylesheet","<link href=\"".$stylepath."/category.css\" rel=\"stylesheet\">");?>
<?php $usr_data=$this->session->userdata("user_data"); ?>
<div class="left_content">
	<h1>ประกาศหมวดหมู่ <?php echo $breadcrumb;?></h1>
		<?php if(!empty($subCategoryList)): ?>
		<nav class="subcategory container">
			<h2>หมวดหมู่ย่อย</h2>
			<ul>
			<?php
			$newAt = round((count($subCategoryList)/4));
			$count = 1;
			foreach ($subCategoryList as $subCategoryListKey => $subCategoryListValue) {
				if($count == 1){
					echo "<ul>";
				}
				echo "<li><a href=\"".$canonical."/".$subCategoryListValue["url"]."\">".$subCategoryListValue["name"]."</a></li>";
				if($count == $newAt){
					echo "</ul>";
					$count = 1;
				}else{
					$count++;
				}
			}
			?>
			</ul>
		</nav>
	 	<?php
	 	Endif;
	 	if(!empty($posts)){
		  echo Util::renderPost($posts);
		}else{
		?>
			<div class="item-list">
					<h4 class="text-center">ยังไม่มีประกาศในหมวดหมู่นี้</h4>
				</div>
		<?php
		}//Endif
		?>
		<div class="pagination text-center"><ul><?php echo $this->pagination->create_links();?></ul></div>
</div>